package lv.solcraft.replication.server.api;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import lv.solcraft.replication.server.bdb.Database;
import lv.solcraft.replication.server.boot.ServerConfig;
import lv.solcraft.replication.server.model.Oper;

@Service
public class CleanExpiredOpers extends AbstractCleanOpersCommand {

    private static final Logger logger = Logger.getLogger(CleanExpiredOpers.class);

    @Autowired
    public CleanExpiredOpers(Database database, ServerConfig serverConfig) {
        super(database, serverConfig);
    }

    @Override
    protected boolean canDelete(Oper oper) {
        return true;
    }

    @Override
    protected Logger getLogger() {
        return logger;
    }

    @Override
    protected int getLimit() {
        return Integer.MAX_VALUE;
    }
}
